﻿using GN.Pay.TradeChannel;
using GN.Pay.TradeChannel.DefaultImpl;
using GN.Pay.TradeChannel.WeiXin.Request;
using GN.Pay.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
using System.Xml.Linq;
using System.Xml.Serialization;

namespace GN.Pay.TradeChannel.WeiXin
{
    /// <summary>
    /// 微信扫码支付
    /// </summary>
    [Serializable]
    public class WeiXinQRCodeService : WeiXinServiceBase
    {
        public override string ChannelId
        {
            get
            {
                return "WeiXin.QRCode";
            }
        }

        public override ChannelType ChannelType
        {
            get
            {
                return ChannelType.Web;
            }
        }

        public override string ChannelName
        {
            get
            {
                return "微信扫码支付";
            }
        }

        public override string TradeType
        {
            get
            {
                return "NATIVE";
            }
        }



        /// <summary>
        /// 申请微信扫码付款
        /// </summary>
        /// <param name="order"></param>
        /// <returns></returns>
        public override ITradePayApplyResult PayApply(IOrderPayApply order)
        {
            var config = this.channelConfigure;
            var request = new QrCodePayRequest(this, order, config);
            return request.Build(this, config);
        }
    }
}
